<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>WindowInfo</title>
<meta http-equiv="Content-Type" Content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="../../styles/styles.css">
<script language="javascript" src='../links.js' type="text/javascript"></script>
</head>
<body>

<h1>WindowInfo</h1>
<div class=navbar>
<a href="../index.html">main</a> |
<a  href="index.html">structures</a><br>
</div>

<div class=shortdescr>
The <dfn>WindowInfo</dfn> structure contains information about one FAR Manager window.
A plugin can retrieve this information using the
<a href="../service_functions/advcontrol.html#ACTL_GETWINDOWINFO">ACTL_GETWINDOWINFO</a> command.
</div>

<pre class=syntax>
struct WindowInfo{
  int  Pos;
  int  Type;
  int  Modified;
  int  Current;
  char TypeName[64];
  char Name[NM];
};
</pre>
<h3>Elements</h3>
<div class=descr>
    <div class=dfn>Pos</div>
    <div class=dfndescr>Zero-based number of the window to retrieve information for.
      <var>Pos</var> = -1 will return information for the current window.
    </div>
    <div class=dfn>Type</div>
    <div class=dfndescr>Window type. Can be one of the following (the <a name="WINDOWINFO_TYPE">WINDOWINFO_TYPE</a> enumeration):
    <table class="cont">
    <tr class="cont"><th class="cont" width="40%">Type</th><th class="cont" width="60%">Description</th></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="WTYPE_PANELS">WTYPE_PANELS</a></td>
     <td class="cont" width="60%">File panels.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="WTYPE_VIEWER">WTYPE_VIEWER</a></td>
      <td class="cont" width="60%">Internal viewer window.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="WTYPE_EDITOR">WTYPE_EDITOR</a></td>
      <td class="cont" width="60%">Internal editor window.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="WTYPE_DIALOG">WTYPE_DIALOG</a></td>
      <td class="cont" width="60%">Dialog.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="WTYPE_VMENU">WTYPE_VMENU</a></td>
      <td class="cont" width="60%">Menu.</td></tr>
     <tr class="cont"><td class="cont" width="40%"><a name="WTYPE_HELP">WTYPE_HELP</a></td>
      <td class="cont" width="60%">Help window.</td></tr>
    </table>
    </div>
    <div class=dfn>Modified</div>
    <div class=dfndescr>Modification flag.
      Can be set only if <dfn>Type</dfn> = <dfn>WTYPE_EDITOR</dfn>.
    </div>
    <div class=dfn>Current</div>
    <div class=dfndescr>Nonzero if the window is active.
    </div>
    <div class=dfn>TypeName</div>
    <div class=dfndescr>The name of the window type (Panels,View,Edit,Help,VMenu),
     depends on the current language setting of Far.
    </div>
    <div class=dfn>Name</div>
    <div class=dfndescr>Window title. For <dfn>WTYPE_VIEWER</dfn> and
       <dfn>WTYPE_EDITOR</dfn> windows this is a file name. For panels, the name of the currently selected file object.
       For the help window - full path to the opened HLF file. For menu and dialogs - header.
    </div>
</div>

<h3>Example</h3>
<div class=descr>
<pre class=code>
void GetFarWindowInfo()
{
  WindowInfo WInfo;
  int CountWindow;
  int I;
  FILE *Fp;

  if((Fp=fopen("window.log","a+t")) == NULL)
      return ;

  // request window count
  CountWindow=(int)Info.AdvControl(Info.ModuleNumber,ACTL_GETWINDOWCOUNT,NULL);
  fprintf(Fp,"WindowCount=%i\n",CountWindow);

  for ( I=0; I &lt; CountWindow; I++ )
  {
    WInfo.Pos=I;

    // request window information
    Info.AdvControl(Info.ModuleNumber,ACTL_GETWINDOWINFO,(void*)&amp;WInfo);

    // output it
    fprintf(Fp,"Window[%i], Type=%i (%s), File=[%s] Current=%i, Modified=%i\n",
               I,WInfo.Type,WInfo.TypeName,WInfo.Name,
               WInfo.Current,WInfo.Modified);
  }
  fclose(Fp);

  // set window number 1 (i.e. second)
  Info.AdvControl(Info.ModuleNumber,ACTL_SETCURRENTWINDOW,(void*)1);
}
</pre>
</div>

<div class=see>See also:</div><div class=seecont>
<a href="index.html">structures</a> |
<a href="../service_functions/advcontrol.html">AdvControl</a> |
<a href="../delphi/twindowinfo.html">TWindowInfo</a>
</div>

</body>
</html>
